<%-- 
    Document   : Authenticate
    Created on : Sep 28, 2013, 5:00:50 PM
    Author     : Bach
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib  prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<html:html >
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Authenticator Admin | Sign In</title>
        <link rel="stylesheet" href="resources/css/reset.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="resources/css/style.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="resources/css/invalid.css" type="text/css" media="screen" />	

    </head>

    <body id="login">

        <div id="login-wrapper" class="png_bg">
            <div id="login-top">

                <h1>Admin Authenticator </h1>
                <!-- Logo (221px width) -->
                <img id="logo" src="resources/images/logo_admin.gif" alt="Simpla Admin logo" />
            </div> <!-- End #logn-top -->

            <div id="login-content">
                <c:set  var="fail" value='<%=request.getParameter("autthen")%>'/>
                <c:if test="${fail==0}">
                    <script type="text/javascript">
                        this.document.getElementById("passmess").innerHTML="Password or User name incorrect"; 
                    </script>                               
                    <div class="notification information png_bg">
                        <div>Password or User name incorrect</div>
                    </div>
                </c:if>
                  <div class="clear"></div>
                <html:form action="/adminLogin" onsubmit="return validate();" method="post">

                    <div class="notification information png_bg" id="showms">
                        <div id="usmess">
                            
                        </div>
                        <div id="passmess"> </div>
                    </div>

                    <p>
                        <label>Username</label>
                        <html:text styleClass="text-input" styleId="usID" property="userName" ></html:text>
                        <html:errors property="userName"/>
                    </p>
                    <div class="clear"></div>
                    <p>
                        <label>Password</label>
                        <html:password styleClass="text-input"  styleId="passID" property="passWord" />
                        <html:errors property="passWord"/>
                    </p>
                    <div class="clear"></div>

                    <p>
                        <html:submit styleClass="button"  value="Sign In" />
                    </p>

                </html:form>
            </div> <!-- End #login-content -->

        </div> <!-- End #login-wrapper -->
        <script type="text/javascript" >
            function validate() {
                var usname = this.document.getElementById("usID").value;
                var pass = this.document.getElementById("passID").value;

                if (usname === "") {
                    this.document.getElementById("usmess").innerHTML = "Enter User "
                    this.document.getElementById("usID").focus();
                    return false;
                }

                if (pass === "") {
                    this.document.getElementById("passmess").innerHTML = " Enter Password "
                    this.document.getElementById("passID").focus();
                    return false;
                }
                return true;
            }
        </script>
    </body>
</html:html>

